package com.itheima.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class Aspect2 {

    @Around("@annotation(com.itheima.aop.Log)")
    //Log,自定义注解，需要增强那个方法，就在那个方法上加上这个注解
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        log.info("annotation 用于增强指定的方法或类.........");
        Object result = pjp.proceed();
        return result;
    }
}
